# -*- coding: utf_8 -*-
# @Time : 2021/8/31 0031 15:20
# @Author : yh
# @Remark : 待修库view

from mxsoftpy import View

from server.common.VideoManage.VideoQuality.repair_warehouse import RepairServer
from utils.public.params_method import check_params


class RepairAdd(View):
    def post(self):
        """
        添加视频到待修库
        """
        check_params(self.request.POST, ['videos', 'personnel'])
        return "所有视频均添加到待修库成功", RepairServer().create(**self.request.POST)


class RepairDelete(View):
    def post(self):
        """
        从待修库删除视频
        """
        check_params(self.request.POST, ['videos'])
        return '删除成功', RepairServer().delete(**self.request.POST)


class RepairSelect(View):
    def post(self):
        """
        查询待修库
        """
        check_params(self.request.POST, ['select_param'])
        return '查询待修库成功', RepairServer().select(**self.request.POST)
